/**
 * 
 */
package com.zhz.project.dal.ibatis;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.zhz.project.dal.daointerface.TocDAO;
import com.zhz.project.dal.dataobject.Toc;

/**
 * @author lidian
 * 
 */
public class TocDAOImpl extends SqlMapClientDaoSupport implements TocDAO {
	public void insertToc(Toc toc) {
		getSqlMapClientTemplate().insert("insertToc", toc);
	}

	public void deleteTocById(Toc toc) {
		getSqlMapClientTemplate().delete("deleteTocById", toc.getId());

	}

	public int getAllTocsCount() {
		return ((Integer) getSqlMapClientTemplate().queryForObject(
				"selectAllTocsCount")).intValue();
	}

	public void selectTocById(Toc toc) {
		getSqlMapClientTemplate().delete("selectTocById", toc.getId());

	}

	public void updateToc(Toc toc) {
		getSqlMapClientTemplate().update("updateToc ", toc);
	}

}
